package metier.Service;

import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import metier.entities.TransportCat;
import metier.sess.ITransportCatLocal;


@Stateless
@WebService
public class TransportCatService {
	@EJB(beanName="TransportCat")
	private ITransportCatLocal metier;
	
	
	@WebMethod
	public void addTransportCat(@WebParam(name="Intitule")String Initule,@WebParam(name="Statut")boolean statut)
	{
		//TransportCat tr=new TransportCat(Initule, statut);
		//metier.addTransportCat(tr);
	}
	
	@WebMethod
	public List<TransportCat> listTransportCat()
	{
		return metier.getAllTransportCat();
	}
	
	@WebMethod 
	public TransportCat getTransportCat(@WebParam(name="Id")Integer Id)
	{
		return metier.getTransportCat(Id);
	}
	
	
	@WebMethod
	public void UpdateTransportCat(@WebParam(name="Id")Integer Id,@WebParam(name="Intitule")String Intitule,@WebParam(name="Statut")boolean statut)
	{
	
		TransportCat Tr=metier.getTransportCat(Id);
		Tr.setIntitule(Intitule);
		Tr.setStatut(statut);
		metier.updateTransportCat(Tr);
		
	}
	
	
	@WebMethod
	public void DeleteTransportCat(@WebParam(name="Id")Integer Id)
	{
		metier.deleteTransportCat(Id);
	}
	
	
	
	
	
}
